<extend name="layout/main" />

<block name="HEADER">
	<style type="text/css">
		#grid .layui-table-view .layui-table td .layui-table-cell{
			height: 36px;
		    line-height: 36px;
		}
		.file-img {
		    height: 100%;
		    background-position: left;
		    background-size: 100% 85%;
		    background-repeat: no-repeat;
		    cursor: pointer;
		}
	</style>
</block>

<block name="CONTENT">
	<div class="wrapper">
		<div class="panel-heading">
			<control:search id="searchs" />
		</div>
		<div class="content">
			<control:grid id="grid" padding="0" height="100%" />
		</div>
	</div>
</block>

<block name="FOOTER">
	<script type="text/javascript">
		var page = (function(ns){
     
		    //页面初始化
		    ns.init=function(){
		        ns.query();
		    }
		    
		    //搜索事件
		    ns.query=function(){
		    	grid.load( searchs.getData() );
		    }
		    
		    //回复
		    ns.reply=function(id){
		    	var ids = grid.getSelectedColumnValue('id');
	        	if( !ids ){
		        	$.toast(0,"请选择要操作的数据！");
		            return;
		        }
		    	function yesFn(index){
			        $(".J-changeStatus").validformIn(function(data){ 
			        	grid.updateField(ids,'reply_uid',__user_id__);
			        	grid.updateField(ids,'reply_content',data.desc);
		                layer.close(index);
			        });
			    }
			    let html= template("grid-tpl-reason",{});
			    $.openModalDialog(template("grid-tpl-reason",{}),"确认",null,yesFn,["400px","250px"]);
		    }
		    
		    return ns;
		}({}));
		
		
		$(function(){ page.init();  });

	</script>
</block>